/*
 * XML Type:  StatementEndResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.StatementEndResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML StatementEndResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class StatementEndResponseImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.StatementEndResponse
{
    
    public StatementEndResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CURDEF$0 = 
        new javax.xml.namespace.QName("", "CURDEF");
    private static final javax.xml.namespace.QName BANKACCTFROM$2 = 
        new javax.xml.namespace.QName("", "BANKACCTFROM");
    private static final javax.xml.namespace.QName CLOSING$4 = 
        new javax.xml.namespace.QName("", "CLOSING");
    
    
    /**
     * Gets the "CURDEF" element
     */
    public net.ofx.types.x2003.x04.CurrencyEnum.Enum getCURDEF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.CurrencyEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "CURDEF" element
     */
    public net.ofx.types.x2003.x04.CurrencyEnum xgetCURDEF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CurrencyEnum target = null;
            target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().find_element_user(CURDEF$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "CURDEF" element
     */
    public void setCURDEF(net.ofx.types.x2003.x04.CurrencyEnum.Enum curdef)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CURDEF$0);
            }
            target.setEnumValue(curdef);
        }
    }
    
    /**
     * Sets (as xml) the "CURDEF" element
     */
    public void xsetCURDEF(net.ofx.types.x2003.x04.CurrencyEnum curdef)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CurrencyEnum target = null;
            target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().add_element_user(CURDEF$0);
            }
            target.set(curdef);
        }
    }
    
    /**
     * Gets the "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount getBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "BANKACCTFROM" element
     */
    public void setBANKACCTFROM(net.ofx.types.x2003.x04.BankAccount bankacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$2);
            }
            target.set(bankacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount addNewBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$2);
            return target;
        }
    }
    
    /**
     * Gets array of all "CLOSING" elements
     */
    public net.ofx.types.x2003.x04.Closing[] getCLOSINGArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CLOSING$4, targetList);
            net.ofx.types.x2003.x04.Closing[] result = new net.ofx.types.x2003.x04.Closing[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "CLOSING" element
     */
    public net.ofx.types.x2003.x04.Closing getCLOSINGArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Closing target = null;
            target = (net.ofx.types.x2003.x04.Closing)get_store().find_element_user(CLOSING$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "CLOSING" element
     */
    public int sizeOfCLOSINGArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CLOSING$4);
        }
    }
    
    /**
     * Sets array of all "CLOSING" element
     */
    public void setCLOSINGArray(net.ofx.types.x2003.x04.Closing[] closingArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(closingArray, CLOSING$4);
        }
    }
    
    /**
     * Sets ith "CLOSING" element
     */
    public void setCLOSINGArray(int i, net.ofx.types.x2003.x04.Closing closing)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Closing target = null;
            target = (net.ofx.types.x2003.x04.Closing)get_store().find_element_user(CLOSING$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(closing);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "CLOSING" element
     */
    public net.ofx.types.x2003.x04.Closing insertNewCLOSING(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Closing target = null;
            target = (net.ofx.types.x2003.x04.Closing)get_store().insert_element_user(CLOSING$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "CLOSING" element
     */
    public net.ofx.types.x2003.x04.Closing addNewCLOSING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Closing target = null;
            target = (net.ofx.types.x2003.x04.Closing)get_store().add_element_user(CLOSING$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "CLOSING" element
     */
    public void removeCLOSING(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CLOSING$4, i);
        }
    }
}
